package com.develop.data.loan.manager.change.amount;

import com.develop.data.loan.manager.change.amount.api.LoanInstallmentAmountClear;
import com.develop.data.loan.model.LoanInstallment;
import org.springframework.stereotype.Component;

import javax.money.MonetaryAmount;
import java.time.LocalDateTime;

@Component("L0001B0001LoanInstallmentInterestClear")
public class L0001B0001LoanInstallmentInterestClear implements LoanInstallmentAmountClear {

    public MonetaryAmount preview(LoanInstallment installment, LocalDateTime localDate){
        return new L0001B0001LoanInstallmentInterestBudget().preview(installment, localDate);
        
    }

    public void execute(LoanInstallment loanInstallment, LocalDateTime localDate){
        new L0001B0001LoanInstallmentInterestBudget().execute(
                loanInstallment, localDate, this.preview(loanInstallment, localDate)
        );
    }
}
